package com.junsi.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


















import com.junsi.bean.Sale;
import com.junsi.bean.Usertracking;
import com.junsi.mapper.SaleMapper;
import com.junsi.mapper.UsertrackingMapper;
import com.junsi.service.SaleService;
import com.junsi.service.UsertrackingService;
import com.junsi.util.PageUtil;

/**   
  * @文件名: SaleServiceImpl.java 
  * @包名: com.junsi.service.impl 
  * @类名: SaleServiceImpl   
  * @时间: 2017年6月28日 上午9:21:00 2017
  * @作者: 
  * @类功能描述:TODO 请简要描述你的类   
  */
@Service
@Transactional(rollbackFor = Exception.class)
public class UsertrackingServiceImpl implements UsertrackingService {
	
	@Autowired
	private UsertrackingMapper usertrackingMapper;

	@Override
	public boolean save(Usertracking usertracking) {
		int result = usertrackingMapper.save(usertracking);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public boolean deleteById(Integer id) {
		int result = usertrackingMapper.deleteById(id);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public boolean update(Usertracking usertracking){
		int result = usertrackingMapper.update(usertracking);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public List<Usertracking> findByAll() {
		return usertrackingMapper.findByAll();
	}

	@Override
	public Usertracking findByID(Integer id) {
		return usertrackingMapper.findById(id);
	}

	public List<Usertracking> pageFind(String[] id,String statu,Integer endIndex,Integer startIndex) {
		if(endIndex == null){
			return null;
		}
		if(startIndex == null){
			return null;
		}
		
		return usertrackingMapper.pageFind(id, statu,endIndex, startIndex);
	}

	public int findCount(String[] id,String statu) {
		// TODO Auto-generated method stub
		return usertrackingMapper.findCount(id,statu);
	}

	public boolean deletes(String ids) {
		// TODO Auto-generated method stub
		return false;
	}

	public List<Usertracking> findByName(String select,String statu,String[] id,Integer endIndex,Integer startIndex) {
		select = "%"+select+"%";
		
		return usertrackingMapper.findByName(select,statu,id,endIndex,startIndex);
	}
	
}
